{include file="header.html"}

<div id="container">
	<div id="wrapper">
		<header>
			<div class="center">
				{if count($languages) > 1}
				<div class="languages">
					<ul>
					{foreach from=$languages key=name item=code}
						<li{if $language == $code} class="selected"{/if}><a href="./?lang={$code|urlencode}">{$name|htmlentities:3:'UTF-8'}</a></li>
					{/foreach}
					</ul>
				</div>
				{/if}
				
				{if $loggedin || $guestview}
				<nav>
					<ul>
						<li{if $currentUrl == $webroot} class="selected"{/if}><a href="{$webroot}">{$smarty.const.HOME|htmlentities:3:'UTF-8'}</a></li>
						{if $loggedin}
						<li{if $currentUrl == $webroot|cat:"?go=profile"} class="selected"{/if}><a href="{$webroot}?go=profile">{$smarty.const.MY_PROFILE|htmlentities:3:'UTF-8'}</a></li>
						{if $loggedin && $User->isAdmin()}<li{if $currentUrl == $webroot|cat:"?go=users"} class="selected"{/if}><a href="{$webroot}?go=users">{$smarty.const.USER_MANAGEMENT|htmlentities:3:'UTF-8'}</a></li>{/if}
						<li><a href="{$webroot}?logout" onclick="return confirm('{$smarty.const.ARE_YOU_SURE_YOU_WANT_TO_LOG_OUT|htmlentities:3:'UTF-8'}');">{$smarty.const.LOG_OUT|htmlentities:3:'UTF-8'}</a></li>
						{else}
						<li{if $currentUrl == $webroot|cat:"?go=login"} class="selected"{/if}><a href="{$webroot}?go=login&ref={$currentUrl|urlencode}">{$smarty.const.LOG_IN|htmlentities:3:'UTF-8'}</a></li>
						{/if}
					</ul>
				</nav>
				{/if}
				
				<a href="{$webroot}"><h1>{$smarty.const.MY_COLLECTION|htmlentities:3:'UTF-8'}</h1></a>
			</div>
		</header>
		
		<div id="content">
			<section>
				{if !$loggedin && !$guestview}
					{include file="users/login.html"}
				{/if}
		
				{if $loggedin || $guestview}
					{if isset($main)}{include file="$main"}{/if}
				{/if}
			</section>
		</div>
	</div>
	
	<footer>
		<a href="http://php4dvd.sourceforge.net/" target="_blank">php4dvd v{$version|number_format:1}</a>
	</footer>
</div>

{if isset($message)}
<div class="message">
	<div class="text">
		{translate($message)|htmlentities:3:'UTF-8'}
	</div>
</div>
{/if}

{include file="footer.html"}